import sys
from math import *

def triangulation(Xa,Ya,Xb,Yb,Xc,Yc):
    print "Donnees :"
    print 'Xa = ', Xa, 'Ya = ', Ya
    print 'Xb = ', Xb, 'Yb = ', Yb
    print 'Xc = ', Xc, 'Yc = ', Yc
    # Numer pour Numerateur
    # Parant pour Paranthese
    YoNumerParant1 = Yc**2 - Yb**2 + Xc**2 - Xb**2
    # print YoNumerParant1
    YoNumerParant2 = Ya**2 - Yc**2 + Xa**2 - Xc**2
    # print YoNumerParant2
    YoNumerParant3 = Yb**2 - Ya**2 + Xb**2 - Xa**2
    # print YoNumerParant3
    YoNumer = Xa * YoNumerParant1 + Xb * YoNumerParant2 + Xc * YoNumerParant3
    # print 'Yo Numerateur = ', YoNumer

    # Denom pour Denominateur
    # Parant pour Paranthese
    YoDenomParant1 = Yb - Yc
    # print 'Yb - Yc = ', YoDenomParant1
    YoDenomParant2 = Xc - Xa
    # print 'Xc - Xa = ', YoDenomParant2
    YoDenomParant3 = Ya - Yc
    # print 'Ya - Yc = ', YoDenomParant3
    YoDenomParant4 = Xc - Xb
    # print 'Xc - Xb = ', YoDenomParant4
    YoDenomParant = YoDenomParant1 * YoDenomParant2 - YoDenomParant3 * YoDenomParant4
    # print YoDenomParant
    YoDenom = 2 * YoDenomParant
    # print 'Yo Denominateur = ', YoDenom
    Yo = YoNumer / YoDenom
    # print 'Yo = ', Yo

    XoNumerParant1 = Yc - Yo
    XoNumerParant2 = Yb - Yo
    XoNumer = XoNumerParant1**2 - XoNumerParant2**2 + Xc**2 - Xb**2
    XoDenom = 2 * (Xc - Xb)
    Xo = XoNumer / XoDenom
    # print 'Xo = ', Xo

    Rr = (Xa - Xo)**2 + (Ya - Yo)**2
    R = sqrt(Rr)
    
    print "Resultats :"
    print 'Abscisse = ', Xo, 'Ordonnee = ', Yo
    print 'Rayon = ', R

triangulation(2., 3., 3., 1., 1., 1.)
